Ext.define('channel.commodity.CommodityLogWin',{
	_winType : 'search',
	closeAction : 'hide',
	extend : 'Ext.window.Window',
	width : 500,
	resizable : false,
	modal : true,	
	initComponent : function(){
		this.form = Ext.create('Ext.form.Panel',{
			border : false,		
			bodyPadding: 5,
			defaults : {labelAlign : 'right',anchor:'90%',xtype:'textfield'},
			items :[
				{name:'id',xtype:'hiddenfield'},
				{
			        fieldLabel: '商品编号',
			        name: 'commodity',
			        maxLenght : 15,
			        allowBlank: false
			    },
			    {
					fieldLabel:'渠 道',
	                xtype: 'radiogroup',
	                layout: 'column',
	                defaults: {
	                    name: 'distribute',
	                    margins: '0 10 0 0'
	                },
	                items: [{
	                    inputValue: 0,
	                    boxLabel: '所有渠道',
	                    checked: true
	                },{
	                    inputValue: 110,
	                    boxLabel: '淘宝商城 '
	                }, {
	                    inputValue: 123,
	                    boxLabel: '淘宝医学店 '
	                }, {
	                    inputValue: 122,
	                    boxLabel: '淘宝经管店 '
	                }, {
	                    inputValue: 111,
	                    boxLabel: '拍拍商城 '
	                }, {
	                    inputValue: 123,
	                    boxLabel: '新浪商城  '
	                }, {
	                    inputValue: 120,
	                    boxLabel: '我有商城 '
	                }]
	            }
			]
		});
		this.items = [this.form];
		this.buttons = [
			{text:'查询',scope:this,handler:this._search},
			{text:'取消',scope:this,handler:function(){this.hide();}}
		];
		this.callParent();
		this.on('hide',function(){this.form.form.reset();},this);
		this.on('show',function(){	
			this.form.form.reset();
			var o = this.fcmp;			
			this.form.form.findField('commodity').focus(true,true);
		},this);
	},
	_search : function(){
		if(this.form.form.isValid()){
			var dataIn = this.form.form.getValues();
			distributeArgs.distribute = dataIn.distribute;
			distributeArgs.commodity = dataIn.commodity;
			this.fcmp.center.store.load();
			this.hide();
			distributeArgs.commodity = 0;
		}
	}
});